#include <iostream>
#include <algorithm>

using namespace std;

typedef struct
{   
    int strong;
    int score;
    int index;
} Data;

Data datas[200086];
Data temps[200086];

bool compare(const Data& a, const Data& b)
{
    if (a.score > b.score) return true;
    if (a.score < b.score) return false;
    if (a.index < b.index) return true;
    else return false;    
}

void msort(Data *first, Data *last)
{
    int tempIndex, i;
    Data *index, *left, *right;

    if (first == last) return;
    index = first + (last - first) / 2;
    
    msort(first, index);
    msort(index + 1, last);

    tempIndex = 0;
    left = first;
    right = index + 1;

    while (left <= index && right <= last)
    {
        if (compare(*left, *right))
        {
            temps[tempIndex++] = *left;
            left++;
        }
        else
        {
            temps[tempIndex++] = *right;
            right++;
        }
        
    }
    while (left <= index)
    {
        temps[tempIndex++] = *left;
        left++;
    }
    while (right <= last)
    {
        temps[tempIndex++] = *right;
        right++;
    }

    for (i = 0; i < tempIndex; i++)
    {
        *(first + i) = temps[i];
    }
}

int main(int argc, char const *argv[])
{
    int n, r, q;
    int i, j, k;

    cin >> n >> r >> q;

    for (i = 0; i < 2 * n; i++)
        datas[i].index = i + 1;

    for (i = 0; i < 2 * n; i++)
        cin >> datas[i].score;

    for (i = 0; i < 2 * n; i++)
        cin >> datas[i].strong;

    sort(datas, datas + 2 * n, compare);

    for (i = 0; i < r; i++)
    {
        for (j = 0; j < 2 * n; j += 2)
        {
            if (datas[j].strong > datas[j + 1].strong)
                datas[j].score++;
            else
                datas[j + 1].score++;
        }

        msort(datas, datas + 2 * n);
    }


    cout << datas[q - 1].index;

    return 0;
}
